//-------------------------------------------------------------------
//	Copyright (c) 2010-2012 Zhirnov Andrey
//	This file is part of the "UXGEN" project.
//	See copyright notice in "Engine.h".
//-------------------------------------------------------------------

#ifndef _UX_TBO_MANAGER_H
#define _UX_TBO_MANAGER_H

#include <Includes.h>

namespace Engine
{
namespace RenderUtils
{

	//
	// TBO Manager
	//

	class _EXPORT_ CTBOManager : public CEngBaseObject
	{
	protected:
		typedef array< CTextureBufferPtr >	tbo_array_t;

	protected:
		tbo_array_t		_aAllTBOs,
						_aFreeTBOs;

	public:
		CTBOManager();
		~CTBOManager();

		bool Create(uint uCount);
		void Destroy();

		bool GetTBO(CTextureBufferPtr &pTBO);
		void FreeTBO(const CTextureBufferPtr &pTBO);

		// CEngBaseObject //
		virtual void Release();
	};

//-------------------------------------------------------------------

}	// RenderUtils
}	// Engine

#endif	// _UX_TBO_MANAGER_H